package com.soft.javase.day10.consolidation.log;

import java.time.LocalDateTime;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/5/4
 */
public class Log {
    public static void testLog(int level ,String msg){
        if(level == 3){
            System.out.println(msg);
        }
    }

    public static void testLogByLogFunctionalInterface(int level ,LogFunctionalInterface log){
        if(level == 3){
            log.test();
        }
    }

    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        String type = "NullPointerException";
        String line = "log.java 111";

        testLog(1,now +","+type+","+line);

        testLogByLogFunctionalInterface(3,()-> System.out.println(now +","+type+","+line));
    }

}
